﻿@{
    ViewBag.Title = "Thẻ vip";
}
@using KimPhongCRM.Models
@model List<sp_ThongKe_TheVip_Result> 
@{int sum = Convert.ToInt32(Model.Sum(s => s.sl));}
<div class="box span4" ontablet="span6" ondesktop="span4">
    <div class="box-header">
        <h2><i class="icon-tasks"></i><span class="break"></span>Thống kê các loại thẻ</h2>
        <div class="box-icon">
            <a href="#" class="btn-minimize"><i class="icon-chevron-up"></i></a>
        </div>
    </div>
    <div class="box-content">
        @foreach (var value in Model)
        {
            decimal psl = Math.Round((decimal)value.sl / sum, 2) * 100;
            <div class="progressBarValue">
                <span>@value.tenThe (@value.sl thẻ)</span> <span class="progressCustomValueVal">@{Write(psl);}</span>
                @if (value.tenThe.ToLower().Contains("kim cương"))
                { 
                    <div class="progressSlim progressCustomValue progressBlue "></div>
                }
                else if (value.tenThe.ToLower().Contains("vàng"))
                {
                    <div class="progressSlim progressCustomValue progressYellow"></div>
                }
                else if (value.tenThe.ToLower().Contains("đỏ"))
                {
                    <div class="progressSlim progressCustomValue progressRed"></div>
                }
                else
                {
                    <div class="progressSlim progressCustomValue"></div>
                }
            </div>
        }

    </div>
</div>

